// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
import QtQuick 1.1
import QtQuick 1.0

Item {
    width: back.width/2
    height: back.height
    id:root
    clip: true

    property int value: 0

    signal resetToBank()

    Image {
        id:back
        x: 0
        y: 0
        source: "images/money/for_bank.png"
    }
    Text {
        id: label
        x: -20
        y: 7

        width: root.width
        height: root.height
        text: qsTr(String(root.value))
        font.bold: true
        font.pixelSize: 18
        font.family: "Arial"
        rotation: -20
        color: "white"
        horizontalAlignment: Text.AlignHCenter
        verticalAlignment: Text.AlignVCenter

    }
    MouseArea{
        x: 0
        y: 0
        anchors.rightMargin: 0
        anchors.bottomMargin: 0
        anchors.leftMargin: 0
        anchors.topMargin: 0
        anchors.fill: root
        hoverEnabled: true
        acceptedButtons: Qt.LeftButton
        onEntered: {
            back.x = -back.width/2;
        }
        onExited: {
            back.x = 0
        }
        onClicked: {
            resetToBank();
        }
    }
    function setValue(val){
        root.value = val;
        label.text = qsTr(String(val));
    }
}
